package com.adam.example.util;

import java.lang.reflect.Field;

public class ReflectUtil {

    public static <T> T getPrivateField(Object object, String fieldName) throws NoSuchFieldException, IllegalAccessException {
        Field field = object.getClass().getDeclaredField(fieldName);
        field.setAccessible(true);
        Object fieldObject = field.get(object);
        return (T) fieldObject;
    }

}
